{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "85a8fc3f",
   "metadata": {
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "# 导言区"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "f397dd62",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import scipy.constants as sc"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "79c7c6af",
   "metadata": {
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "## 例题01-01"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "daa3b372",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(1) q = 1.50e+06 W/m^2\n",
      "(2) q = 1.46e+05 W/m^2\n",
      "(3) q = 9.28e+03 W/m^2\n",
      "(4) q = 9.68e+02 W/m^2\n"
     ]
    }
   ],
   "source": [
    "delta = 50e-3\n",
    "t_w1 = 300\n",
    "t_w2 = 100\n",
    "\n",
    "lambda_ = np.array([375, 36.4, 2.32, 0.242])\n",
    "q = lambda_ * (t_w1 - t_w2) / delta\n",
    "\n",
    "for i, q_ in enumerate(q):\n",
    "    print(f\"({i+1}) q = {q_:.2e} W/m^2\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8ea4140c",
   "metadata": {
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "例题01-02"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "89fb1fcc",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "管道的总散热量为：431.88 W/m\n"
     ]
    }
   ],
   "source": [
    "d = 583e-3\n",
    "t_w = 48\n",
    "t_f = 23\n",
    "h = 3.42\n",
    "epsilon = 0.9\n",
    "\n",
    "T_w = sc.convert_temperature(t_w, 'C', 'K')\n",
    "T_f = sc.convert_temperature(t_f, 'C', 'K')\n",
    "\n",
    "q_conv = np.pi * d * h * (t_w - t_f)\n",
    "q_radi = epsilon * sc.sigma * (np.pi * d) * (T_w ** 4 - T_f ** 4)\n",
    "q_tot = q_conv + q_radi\n",
    "print(f\"管道的总散热量为：{q_tot:.2f} W/m\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "65d7b32d",
   "metadata": {
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "## 例题01-03"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "4094abc2",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "单位时间内单位面积钢板上所发出的辐射能为：460.22 W/m^2\n"
     ]
    }
   ],
   "source": [
    "epsilon = 0.8\n",
    "t = 27\n",
    "\n",
    "T = sc.convert_temperature(t, 'C', 'K')\n",
    "\n",
    "q = sc.sigma * T**4\n",
    "print(f\"单位时间内单位面积钢板上所发出的辐射能为：{q:.2f} W/m^2\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f1630f29",
   "metadata": {
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "## 例题01-04"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "cbee7d1c",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "应从蒸气侧环节入手，减小其热阻\n"
     ]
    }
   ],
   "source": [
    "h_1 = 8700\n",
    "h_2 = 1800\n",
    "delta = 1.5e-3\n",
    "lambda_ = 383\n",
    "\n",
    "R_1 = 1 / h_1\n",
    "R_2 = delta / lambda_\n",
    "R_3 = 1 / h_2\n",
    "R = np.array([R_1, R_2, R_3])\n",
    "position = ['水侧', '管壁', '蒸气侧']\n",
    "arg = np.argmax(R)\n",
    "print(f'应从{position[arg]}环节入手，减小其热阻')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "61e0b275",
   "metadata": {
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "## 例题01-05"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "deb56db1",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "夏天时，人与环境的换热量为：52.02 W\n",
      "冬天时，人与环境的换热量为：173.23 W\n"
     ]
    }
   ],
   "source": [
    "t = 25\n",
    "h = 2.6\n",
    "t_s = 30\n",
    "epsilon = 0.95\n",
    "t_summer = 26\n",
    "t_winter = 10\n",
    "\n",
    "d = 25e-2\n",
    "height = 1.75\n",
    "\n",
    "T_s = sc.convert_temperature(t_s, 'C', 'K')\n",
    "T_summer = sc.convert_temperature(t_summer, 'C', 'K')\n",
    "T_winter = sc.convert_temperature(t_winter, 'C', 'K')\n",
    "\n",
    "A = np.pi * d * height + np.pi * d ** 2 / 4\n",
    "q_conv = h * A * (t_s - t)\n",
    "q_radi_summer = epsilon * sc.sigma * A * (T_s**4 - T_summer**4)\n",
    "q_summer = q_conv + q_radi_summer\n",
    "print(f'夏天时，人与环境的换热量为：{q_summer:.2f} W')\n",
    "q_radi_winter = epsilon * sc.sigma * A * (T_s**4 - T_winter**4)\n",
    "q_winter = q_conv + q_radi_winter\n",
    "print(f'冬天时，人与环境的换热量为：{q_winter:.2f} W')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "35728adb",
   "metadata": {
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "## 例题01-06"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "e096fea7",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "该男子的平均体温下降2.88度\n"
     ]
    }
   ],
   "source": [
    "Phi_1 = 400\n",
    "Phi_2 = 800\n",
    "C = 5e5\n",
    "tau = 1 * sc.hour\n",
    "\n",
    "Phi = Phi_2 - Phi_1\n",
    "Delta_T = Phi / C * tau\n",
    "print(f\"该男子的平均体温下降{Delta_T:.2f}度\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.13"
  },
  "latex_envs": {
   "LaTeX_envs_menu_present": true,
   "autoclose": false,
   "autocomplete": true,
   "bibliofile": "biblio.bib",
   "cite_by": "apalike",
   "current_citInitial": 1,
   "eqLabelWithNumbers": true,
   "eqNumInitial": 1,
   "hotkeys": {
    "equation": "Ctrl-E",
    "itemize": "Ctrl-I"
   },
   "labels_anchors": false,
   "latex_user_defs": false,
   "report_style_numbering": false,
   "user_envs_cfg": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}